home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / glibc108.zip / glibc108 / config.guess < prev    next >
Text File  |  1994-05-10  |  9KB  |  328 lines

  1. #!/bin/sh
  2. # This script attempts to guess a canonical system name.
  3. #   Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
  4. #
  5. # This file is free software; you can redistribute it and/or modify it
  6. # under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful, but
  11. # WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13. # General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  18.  
  19. #
  20. # This script attempts to guess a canonical system name similar to
  21. # config.sub.  If it succeeds, it prints the system name on stdout, and
  22. # exits with 0.  Otherwise, it exits with 1.
  23. #
  24. # The plan is that this can be called by configure scripts if you
  25. # don't specify an explicit system type (host/target name).
  26. #
  27. # Only a few systems have been added to this list; please add others
  28. # (but try to keep the structure clean).
  29. #
  30.  
  31. UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
  32. UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
  33. UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
  34. UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
  35.  
  36. trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
  37.  
  38. # Note: order is significant - the case branches are not exclusive.
  39.  
  40. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
  41.     alpha:OSF1:1.*:*)
  42.     # 1.2 uses "1.2" for uname -r.
  43.     echo alpha-dec-osf${UNAME_RELEASE}
  44.         exit 0 ;;
  45.     alpha:OSF1:V1.*:*)
  46.     # 1.3 uses "V1.3" for uname -r.
  47.     echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^V//'`
  48.     exit 0 ;;
  49.     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
  50.     echo arm-acorn-riscix${UNAME_RELEASE}
  51.     exit 0;;
  52.     sun4*:SunOS:5.*:*)
  53.     echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  54.     exit 0 ;;
  55.     sun4*:SunOS:6*:*)
  56.     # According to config.sub, this is the proper way to canonicalize
  57.     # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
  58.     # it's likely to be more like Solaris than SunOS4.
  59.     echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  60.     exit 0 ;;
  61.     sun4*:SunOS:*:*)
  62.     echo sparc-sun-sunos${UNAME_RELEASE}
  63.     exit 0 ;;
  64.     sun3*:SunOS:*:*)
  65.     echo m68k-sun-sunos${UNAME_RELEASE}
  66.     exit 0 ;;
  67.     RISC*:ULTRIX:*:*)
  68.     echo mips-dec-ultrix${UNAME_RELEASE}
  69.     exit 0 ;;
  70.     VAX*:ULTRIX*:*:*)
  71.     echo vax-dec-ultrix${UNAME_RELEASE}
  72.     exit 0 ;;
  73.     mips:*:5*:RISCos)
  74.     echo mips-mips-riscos${UNAME_RELEASE}
  75.     exit 0 ;;
  76.     m88k:*:4*:R4*)
  77.     echo m88k-motorola-sysv4
  78.     exit 0 ;;
  79.     m88k:*:3*:R3*)
  80.     echo m88k-motorola-sysv3
  81.     exit 0 ;;
  82.     AViiON:dgux:*:*)
  83.      echo m88k-dg-dgux${UNAME_RELEASE}
  84.      exit 0 ;;
  85.     M88*:*:R3*:*)
  86.     # Delta 88k system running SVR3
  87.     echo m88k-motorola-sysv3
  88.     exit 0 ;;
  89.     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
  90.     echo m88k-tektronix-sysv3
  91.     exit 0 ;;
  92.     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
  93.     echo m68k-tektronix-bsd
  94.     exit 0 ;;
  95.     *:IRIX:*:*)
  96.     echo mips-sgi-irix${UNAME_RELEASE}
  97.     exit 0 ;;
  98.     i[34]86:AIX:*:*)
  99.     echo i386-ibm-aix
  100.     exit 0 ;;
  101.     *:AIX:2:3)
  102.     if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
  103.         echo rs6000-ibm-aix3.2.5
  104.     elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
  105.         echo rs6000-ibm-aix3.2.4
  106.     else
  107.         echo rs6000-ibm-aix3.2
  108.     fi
  109.     exit 0 ;;
  110.     *:AIX:*:*)
  111.     echo rs6000-ibm-aix
  112.     exit 0 ;;
  113.     *:BOSX:*:*)
  114.     echo rs6000-bull-bosx
  115.     exit 0 ;;
  116.     DPX/2?00:B.O.S.:*:*)
  117.     echo m68k-bull-sysv3
  118.     exit 0 ;;
  119.     9000/[34]??:4.3bsd:1.*:*)
  120.     echo m68k-hp-bsd
  121.     exit 0 ;;
  122.     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
  123.     echo m68k-hp-bsd4.4
  124.     exit 0 ;;
  125.     9000/[3478]??:HP-UX:*:* | 9000/8?7:HP-UX:*:* )
  126.     case "${UNAME_MACHINE}" in
  127.         9000/31? )            HP_ARCH=m68000 ;;
  128.         9000/[34]?? )         HP_ARCH=m68k ;;
  129.         9000/7?? | 9000/8?7 ) HP_ARCH=hppa1.1 ;;
  130.         9000/8?? )            HP_ARCH=hppa1.0 ;;
  131.     esac
  132.     case ${UNAME_RELEASE} in
  133.         *.B7.* )          HPUX_REV=7 ;;
  134.         *.B8.* | *.08.* ) HPUX_REV=8 ;;
  135.         *.09.* )          HPUX_REV=9 ;;
  136.     esac
  137.     echo ${HP_ARCH}-hp-hpux${HPUX_REV}
  138.     exit 0 ;;
  139.     3050*:HI-UX:*:*)
  140.     sed 's/^    //' << EOF >dummy.c
  141.     #include <unistd.h>
  142.     int
  143.     main ()
  144.     {
  145.       long cpu = sysconf (_SC_CPU_VERSION);
  146.       if (CPU_IS_HP_MC68K (cpu))
  147.         puts ("m68k-hitachi-hiuxwe2");
  148.       else if (CPU_IS_PA_RISC (cpu))
  149.         {
  150.           switch (cpu)
  151.         {
  152.           case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
  153.           case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
  154.           case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
  155.           default: puts ("hppa-hitachi-hiuxwe2"); break;
  156.         }
  157.         }
  158.       else puts ("unknown-hitachi-hiuxwe2");
  159.       exit (0);
  160.     }
  161. EOF
  162.     ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
  163.     rm -f dummy.c dummy
  164.     echo unknown-hitachi-hiuxwe2
  165.     exit 0 ;;
  166.     9000/7??:4.3bsd:*:* | 9000/8?7:4.3bsd:*:* )
  167.     echo hppa1.1-hp-bsd
  168.     exit 0 ;;
  169.     9000/8??:4.3bsd:*:*)
  170.     echo hppa1.0-hp-bsd
  171.     exit 0 ;;
  172.     C1*:ConvexOS:*:* | convex:ConvexOS:C1:*)
  173.     echo c1-convex-bsd
  174.         exit 0 ;;
  175.     C2*:ConvexOS:*:* | convex:ConvexOS:C2:*)
  176.     echo c2-convex-bsd
  177.         exit 0 ;;
  178.     CRAY*X-MP:UNICOS:*:*)
  179.     echo xmp-cray-unicos
  180.         exit 0 ;;
  181.     CRAY*Y-MP:UNICOS:*:*)
  182.     echo ymp-cray-unicos
  183.         exit 0 ;;
  184.     CRAY-2:UNICOS:*:*)
  185.     echo cray2-cray-unicos
  186.         exit 0 ;;
  187.     hp3[0-9][05]:NetBSD:*:*)
  188.     echo m68k-hp-netbsd${UNAME_RELEASE}
  189.     exit 0 ;;
  190.     i[34]86:FreeBSD:*:*)
  191.     echo ${UNAME_MACHINE}-unknown-freebsd
  192.     exit 0 ;;
  193.     i[34]86:NetBSD:*:*)
  194.     echo ${UNAME_MACHINE}-unknown-netbsd${UNAME_RELEASE}
  195.     exit 0 ;;
  196.     i[34]86:Linux:*:*)
  197.     echo ${UNAME_MACHINE}-unknown-linux
  198.     exit 0 ;;
  199.     i[34]86:UNIX_SV:4.*:* | i[34]86:SYSTEM_V:4.*:*)
  200.     if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
  201.         echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
  202.     else
  203.         echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}
  204.     fi
  205.     exit 0 ;;
  206.     i[34]86:*:3.2:*)
  207.     if /bin/uname -X 2>/dev/null >/dev/null ; then
  208.         UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
  209.         (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
  210.         echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL
  211.     else
  212.         echo ${UNAME_MACHINE}-unknown-sysv32
  213.     fi
  214.     exit 0 ;;
  215.     mini*:CTIX:SYS*5:*)
  216.     # "miniframe"
  217.     echo m68010-convergent-sysv
  218.     exit 0 ;;
  219.     M680[234]0:*:R3V[567]*:*)
  220.     test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
  221.     3[34]??:*:4.0:* | 3[34]??,3[34]??:*:4.0:*)
  222.     uname -p 2>/dev/null | grep 86 >/dev/null \
  223.       && echo i486-ncr-sysv4 && exit 0 ;;
  224.     m680[234]0:LynxOS:2.2*:*)
  225.     echo m68k-lynx-lynxos${UNAME_RELEASE}
  226.     exit 0 ;;
  227.     i[34]86:LynxOS:2.2*:*)
  228.     echo i386-lynx-lynxos${UNAME_RELEASE}
  229.     exit 0 ;;
  230.     TSUNAMI:LynxOS:2.2*:*)
  231.     echo sparc-lynx-lynxos${UNAME_RELEASE}
  232.     exit 0 ;;
  233. esac
  234.  
  235. #echo '(No uname command or uname output not recognized.)' 1>&2
  236. #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
  237.  
  238. cat >dummy.c <<EOF
  239. main()
  240. {
  241. #if defined (sony)
  242. #if defined (MIPSEB)
  243.   /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
  244.      I don't know....  */
  245.   printf ("mips-sony-bsd\n"); exit (0);
  246. #else
  247.   printf("m68k-sony-newsos\n"); exit(0);
  248. #endif
  249. #endif
  250.  
  251. #if defined (__arm) && defined (__acorn) && defined (__unix)
  252.   printf("arm-acorn-riscix"); exit (0);
  253. #endif
  254.  
  255. #if defined(hp300) && !defined(hpux)
  256.   printf("m68k-hp-bsd\n"); exit(0);
  257. #endif
  258.  
  259. #if defined(NeXT)
  260. #if !defined(__ARCHITECTURE__)
  261. #define __ARCHITECTURE__ "m68k"
  262. #endif
  263.   int version;
  264.   version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
  265.   if (version==2)
  266.     {
  267.       printf("%s-next-ns2\n", __ARCHITECTURE__);
  268.       exit(0);
  269.     }
  270.   else
  271.     {
  272.       printf("%s-next-ns3\n", __ARCHITECTURE__);
  273.       exit(0);
  274.     }
  275. #endif
  276.  
  277. #if defined (MULTIMAX) || defined (n16)
  278. #if defined (UMAXV)
  279.   printf("ns32k-encore-sysv\n"); exit(0);
  280. #else
  281. #if defined (CMU)
  282.   printf("ns32k-encore-mach\n"); exit(0);
  283. #else
  284.   printf("ns32k-encore-bsd\n"); exit(0);
  285. #endif
  286. #endif
  287. #endif
  288.  
  289. #if defined(__386BSD__) || (defined(__bsdi__) && defined(__i386__))
  290.   printf("i386-unknown-bsd\n"); exit(0);
  291. #endif
  292.  
  293. #if defined(sequent)
  294. #if defined(i386)
  295.   printf("i386-sequent-dynix\n"); exit(0);
  296. #endif
  297. #if defined (ns32000)
  298.   printf("ns32k-sequent-dynix\n"); exit(0);
  299. #endif
  300. #endif
  301.  
  302. #if defined(_SEQUENT_)
  303.   printf("i386-sequent-ptx\n"); exit(0);
  304. #endif
  305.  
  306. #if defined(vax)
  307. #if !defined(ultrix)
  308.   printf("vax-dec-bsd\n"); exit(0);
  309. #else
  310.   printf("vax-dec-ultrix\n"); exit(0);
  311. #endif
  312. #endif
  313.  
  314.   exit (1);
  315. }
  316. EOF
  317.  
  318. ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
  319. rm -f dummy.c dummy
  320.  
  321. # Apollos put the system type in the environment.
  322.  
  323. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
  324.  
  325. #echo '(Unable to guess system type)' 1>&2
  326.  
  327. exit 1
  328.